/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = 'regional';
  
  checkConfig(config);
  @endpoint = getEndpoint('ehpc', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AddNodesRequest {
  clusterId?: string(name='ClusterId'),
  computeSpotPriceLimit?: string(name='ComputeSpotPriceLimit'),
  computeSpotStrategy?: string(name='ComputeSpotStrategy'),
  count?: int32(name='Count'),
  imageId?: string(name='ImageId'),
  imageOwnerAlias?: string(name='ImageOwnerAlias'),
}

model AddNodesResponseBody = {
  instanceIds?: {
    instanceId?: [ string ](name='InstanceId')
  }(name='InstanceIds'),
  requestId?: string(name='RequestId'),
}

model AddNodesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddNodesResponseBody(name='body'),
}

async function addNodesWithOptions(request: AddNodesRequest, runtime: Util.RuntimeOptions): AddNodesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddNodes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addNodes(request: AddNodesRequest): AddNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return addNodesWithOptions(request, runtime);
}

model AddUsersRequest {
  clusterId?: string(name='ClusterId'),
  releaseInstance?: boolean(name='ReleaseInstance'),
  user?: [ 
    {
      group?: string(name='Group'),
      name?: string(name='Name'),
      password?: string(name='Password'),
    }
  ](name='User'),
}

model AddUsersResponseBody = {
  requestId?: string(name='RequestId'),
}

model AddUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddUsersResponseBody(name='body'),
}

async function addUsersWithOptions(request: AddUsersRequest, runtime: Util.RuntimeOptions): AddUsersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'AddUsers',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addUsers(request: AddUsersRequest): AddUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return addUsersWithOptions(request, runtime);
}

model CreateClusterRequest {
  ecsOrder?: {
    compute: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
    }(name='Compute'),
    login: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
    }(name='Login'),
    manager: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
    }(name='Manager'),
  }(name='EcsOrder'),
  accountType?: string(name='AccountType'),
  application?: [ 
    {
      tag?: string(name='Tag'),
    }
  ](name='Application'),
  computeSpotPriceLimit?: string(name='ComputeSpotPriceLimit'),
  computeSpotStrategy?: string(name='ComputeSpotStrategy'),
  description?: string(name='Description'),
  ecsChargeType?: string(name='EcsChargeType'),
  ehpcVersion?: string(name='EhpcVersion'),
  haEnable?: boolean(name='HaEnable'),
  imageId?: string(name='ImageId'),
  imageOwnerAlias?: string(name='ImageOwnerAlias'),
  keyPairName?: string(name='KeyPairName'),
  name?: string(name='Name'),
  osTag?: string(name='OsTag'),
  password?: string(name='Password'),
  remoteDirectory?: string(name='RemoteDirectory'),
  sccClusterId?: string(name='SccClusterId'),
  schedulerType?: string(name='SchedulerType'),
  securityGroupId?: string(name='SecurityGroupId'),
  securityGroupName?: string(name='SecurityGroupName'),
  vSwitchId?: string(name='VSwitchId'),
  volumeId?: string(name='VolumeId'),
  volumeMountpoint?: string(name='VolumeMountpoint'),
  volumeProtocol?: string(name='VolumeProtocol'),
  volumeType?: string(name='VolumeType'),
  vpcId?: string(name='VpcId'),
  zoneId?: string(name='ZoneId'),
}

model CreateClusterResponseBody = {
  clusterId?: string(name='ClusterId'),
  requestId?: string(name='RequestId'),
}

model CreateClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateClusterResponseBody(name='body'),
}

async function createClusterWithOptions(request: CreateClusterRequest, runtime: Util.RuntimeOptions): CreateClusterResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateCluster',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createCluster(request: CreateClusterRequest): CreateClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return createClusterWithOptions(request, runtime);
}

model CreateJobTemplateRequest {
  arrayRequest?: string(name='ArrayRequest'),
  commandLine?: string(name='CommandLine'),
  name?: string(name='Name'),
  packagePath?: string(name='PackagePath'),
  priority?: int32(name='Priority'),
  reRunable?: boolean(name='ReRunable'),
  regionId?: string(name='RegionId'),
  runasUser?: string(name='RunasUser'),
  stderrRedirectPath?: string(name='StderrRedirectPath'),
  stdoutRedirectPath?: string(name='StdoutRedirectPath'),
  variables?: string(name='Variables'),
}

model CreateJobTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  templateId?: string(name='TemplateId'),
}

model CreateJobTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateJobTemplateResponseBody(name='body'),
}

async function createJobTemplateWithOptions(request: CreateJobTemplateRequest, runtime: Util.RuntimeOptions): CreateJobTemplateResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'CreateJobTemplate',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createJobTemplate(request: CreateJobTemplateRequest): CreateJobTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return createJobTemplateWithOptions(request, runtime);
}

model DeleteClusterRequest {
  clusterId?: string(name='ClusterId'),
  releaseInstance?: string(name='ReleaseInstance'),
}

model DeleteClusterResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteClusterResponseBody(name='body'),
}

async function deleteClusterWithOptions(request: DeleteClusterRequest, runtime: Util.RuntimeOptions): DeleteClusterResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteCluster',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteCluster(request: DeleteClusterRequest): DeleteClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteClusterWithOptions(request, runtime);
}

model DeleteJobTemplatesRequest {
  regionId?: string(name='RegionId'),
  templates?: string(name='Templates'),
}

model DeleteJobTemplatesResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteJobTemplatesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteJobTemplatesResponseBody(name='body'),
}

async function deleteJobTemplatesWithOptions(request: DeleteJobTemplatesRequest, runtime: Util.RuntimeOptions): DeleteJobTemplatesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteJobTemplates',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteJobTemplates(request: DeleteJobTemplatesRequest): DeleteJobTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteJobTemplatesWithOptions(request, runtime);
}

model DeleteJobsRequest {
  clusterId?: string(name='ClusterId'),
  jobs?: string(name='Jobs'),
}

model DeleteJobsResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteJobsResponseBody(name='body'),
}

async function deleteJobsWithOptions(request: DeleteJobsRequest, runtime: Util.RuntimeOptions): DeleteJobsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteJobs',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteJobs(request: DeleteJobsRequest): DeleteJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteJobsWithOptions(request, runtime);
}

model DeleteNodesRequest {
  clusterId?: string(name='ClusterId'),
  instance?: [ 
    {
      id?: string(name='Id'),
    }
  ](name='Instance'),
  releaseInstance?: boolean(name='ReleaseInstance'),
}

model DeleteNodesResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteNodesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteNodesResponseBody(name='body'),
}

async function deleteNodesWithOptions(request: DeleteNodesRequest, runtime: Util.RuntimeOptions): DeleteNodesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteNodes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteNodes(request: DeleteNodesRequest): DeleteNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteNodesWithOptions(request, runtime);
}

model DeleteUsersRequest {
  clusterId?: string(name='ClusterId'),
  user?: [ 
    {
      name?: string(name='Name'),
    }
  ](name='User'),
}

model DeleteUsersResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteUsersResponseBody(name='body'),
}

async function deleteUsersWithOptions(request: DeleteUsersRequest, runtime: Util.RuntimeOptions): DeleteUsersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DeleteUsers',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteUsers(request: DeleteUsersRequest): DeleteUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteUsersWithOptions(request, runtime);
}

model DescribeClusterRequest {
  clusterId?: string(name='ClusterId'),
}

model DescribeClusterResponseBody = {
  clusterInfo?: {
    accountType?: string(name='AccountType'),
    applications?: {
      applicationInfo?: [ 
      {
        name?: string(name='Name'),
        tag?: string(name='Tag'),
        version?: string(name='Version'),
      }
    ](name='ApplicationInfo')
    }(name='Applications'),
    clientVersion?: string(name='ClientVersion'),
    createTime?: string(name='CreateTime'),
    description?: string(name='Description'),
    ecsChargeType?: string(name='EcsChargeType'),
    ecsInfo?: {
      compute?: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
      }(name='Compute'),
      login?: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
      }(name='Login'),
      manager?: {
        count?: int32(name='Count'),
        instanceType?: string(name='InstanceType'),
      }(name='Manager'),
    }(name='EcsInfo'),
    haEnable?: boolean(name='HaEnable'),
    id?: string(name='Id'),
    imageId?: string(name='ImageId'),
    imageOwnerAlias?: string(name='ImageOwnerAlias'),
    keyPairName?: string(name='KeyPairName'),
    name?: string(name='Name'),
    osTag?: string(name='OsTag'),
    regionId?: string(name='RegionId'),
    remoteDirectory?: string(name='RemoteDirectory'),
    sccClusterId?: string(name='SccClusterId'),
    schedulerType?: string(name='SchedulerType'),
    securityGroupId?: string(name='SecurityGroupId'),
    status?: string(name='Status'),
    vSwitchId?: string(name='VSwitchId'),
    volumeId?: string(name='VolumeId'),
    volumeMountpoint?: string(name='VolumeMountpoint'),
    volumeProtocol?: string(name='VolumeProtocol'),
    volumeType?: string(name='VolumeType'),
  }(name='ClusterInfo'),
  requestId?: string(name='RequestId'),
}

model DescribeClusterResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DescribeClusterResponseBody(name='body'),
}

async function describeClusterWithOptions(request: DescribeClusterRequest, runtime: Util.RuntimeOptions): DescribeClusterResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'DescribeCluster',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function describeCluster(request: DescribeClusterRequest): DescribeClusterResponse {
  var runtime = new Util.RuntimeOptions{};
  return describeClusterWithOptions(request, runtime);
}

model EditJobTemplateRequest {
  arrayRequest?: string(name='ArrayRequest'),
  commandLine?: string(name='CommandLine'),
  name?: string(name='Name'),
  packagePath?: string(name='PackagePath'),
  priority?: int32(name='Priority'),
  reRunable?: boolean(name='ReRunable'),
  regionId?: string(name='RegionId'),
  runasUser?: string(name='RunasUser'),
  stderrRedirectPath?: string(name='StderrRedirectPath'),
  stdoutRedirectPath?: string(name='StdoutRedirectPath'),
  templateId?: string(name='TemplateId'),
  variables?: string(name='Variables'),
}

model EditJobTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  templateId?: string(name='TemplateId'),
}

model EditJobTemplateResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: EditJobTemplateResponseBody(name='body'),
}

async function editJobTemplateWithOptions(request: EditJobTemplateRequest, runtime: Util.RuntimeOptions): EditJobTemplateResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'EditJobTemplate',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function editJobTemplate(request: EditJobTemplateRequest): EditJobTemplateResponse {
  var runtime = new Util.RuntimeOptions{};
  return editJobTemplateWithOptions(request, runtime);
}

model GetAutoScaleConfigRequest {
  clusterId?: string(name='ClusterId'),
}

model GetAutoScaleConfigResponseBody = {
  clusterId?: string(name='ClusterId'),
  clusterType?: string(name='ClusterType'),
  enableAutoGrow?: boolean(name='EnableAutoGrow'),
  enableAutoShrink?: boolean(name='EnableAutoShrink'),
  excludeNodes?: string(name='ExcludeNodes'),
  extraNodesGrowRatio?: int32(name='ExtraNodesGrowRatio'),
  growIntervalInMinutes?: int32(name='GrowIntervalInMinutes'),
  growRatio?: int32(name='GrowRatio'),
  growTimeoutInMinutes?: int32(name='GrowTimeoutInMinutes'),
  maxNodesInCluster?: int32(name='MaxNodesInCluster'),
  requestId?: string(name='RequestId'),
  shrinkIdleTimes?: int32(name='ShrinkIdleTimes'),
  shrinkIntervalInMinutes?: int32(name='ShrinkIntervalInMinutes'),
  uid?: string(name='Uid'),
}

model GetAutoScaleConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetAutoScaleConfigResponseBody(name='body'),
}

async function getAutoScaleConfigWithOptions(request: GetAutoScaleConfigRequest, runtime: Util.RuntimeOptions): GetAutoScaleConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'GetAutoScaleConfig',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getAutoScaleConfig(request: GetAutoScaleConfigRequest): GetAutoScaleConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getAutoScaleConfigWithOptions(request, runtime);
}

model ListClusterLogsRequest {
  clusterId?: string(name='ClusterId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListClusterLogsResponseBody = {
  clusterId?: string(name='ClusterId'),
  logs?: {
    logInfo?: [ 
    {
      createTime?: string(name='CreateTime'),
      level?: string(name='Level'),
      message?: string(name='Message'),
      operation?: string(name='Operation'),
    }
  ](name='LogInfo')
  }(name='Logs'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListClusterLogsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListClusterLogsResponseBody(name='body'),
}

async function listClusterLogsWithOptions(request: ListClusterLogsRequest, runtime: Util.RuntimeOptions): ListClusterLogsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusterLogs',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listClusterLogs(request: ListClusterLogsRequest): ListClusterLogsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listClusterLogsWithOptions(request, runtime);
}

model ListClustersRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListClustersResponseBody = {
  clusters?: {
    clusterInfoSimple?: [ 
    {
      accountType?: string(name='AccountType'),
      computes?: {
        exceptionCount?: int32(name='ExceptionCount'),
        normalCount?: int32(name='NormalCount'),
        total?: int32(name='Total'),
      }(name='Computes'),
      count?: int32(name='Count'),
      createTime?: string(name='CreateTime'),
      description?: string(name='Description'),
      id?: string(name='Id'),
      imageId?: string(name='ImageId'),
      imageOwnerAlias?: string(name='ImageOwnerAlias'),
      instanceType?: string(name='InstanceType'),
      loginNodes?: string(name='LoginNodes'),
      managers?: {
        exceptionCount?: int32(name='ExceptionCount'),
        normalCount?: int32(name='NormalCount'),
        total?: int32(name='Total'),
      }(name='Managers'),
      name?: string(name='Name'),
      osTag?: string(name='OsTag'),
      regionId?: string(name='RegionId'),
      schedulerType?: string(name='SchedulerType'),
      status?: string(name='Status'),
      totalResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='TotalResources'),
      usedResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='UsedResources'),
      zoneId?: string(name='ZoneId'),
    }
  ](name='ClusterInfoSimple')
  }(name='Clusters'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListClustersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListClustersResponseBody(name='body'),
}

async function listClustersWithOptions(request: ListClustersRequest, runtime: Util.RuntimeOptions): ListClustersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListClusters',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listClusters(request: ListClustersRequest): ListClustersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listClustersWithOptions(request, runtime);
}

model ListCurrentClientVersionResponseBody = {
  clientVersion?: string(name='ClientVersion'),
  requestId?: string(name='RequestId'),
}

model ListCurrentClientVersionResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListCurrentClientVersionResponseBody(name='body'),
}

async function listCurrentClientVersionWithOptions(runtime: Util.RuntimeOptions): ListCurrentClientVersionResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListCurrentClientVersion',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listCurrentClientVersion(): ListCurrentClientVersionResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCurrentClientVersionWithOptions(runtime);
}

model ListCustomImagesRequest {
  baseOsTag?: string(name='BaseOsTag'),
  imageOwnerAlias?: string(name='ImageOwnerAlias'),
  regionId?: string(name='RegionId'),
}

model ListCustomImagesResponseBody = {
  images?: {
    imageInfo?: [ 
    {
      baseOsTag?: {
        architecture?: string(name='Architecture'),
        osTag?: string(name='OsTag'),
        platform?: string(name='Platform'),
        version?: string(name='Version'),
      }(name='BaseOsTag'),
      description?: string(name='Description'),
      imageId?: string(name='ImageId'),
      imageName?: string(name='ImageName'),
      imageOwnerAlias?: string(name='ImageOwnerAlias'),
    }
  ](name='ImageInfo')
  }(name='Images'),
  requestId?: string(name='RequestId'),
}

model ListCustomImagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListCustomImagesResponseBody(name='body'),
}

async function listCustomImagesWithOptions(request: ListCustomImagesRequest, runtime: Util.RuntimeOptions): ListCustomImagesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListCustomImages',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listCustomImages(request: ListCustomImagesRequest): ListCustomImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCustomImagesWithOptions(request, runtime);
}

model ListImagesResponseBody = {
  osTags?: {
    osInfo?: [ 
    {
      architecture?: string(name='Architecture'),
      osTag?: string(name='OsTag'),
      platform?: string(name='Platform'),
      version?: string(name='Version'),
    }
  ](name='OsInfo')
  }(name='OsTags'),
  requestId?: string(name='RequestId'),
}

model ListImagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListImagesResponseBody(name='body'),
}

async function listImagesWithOptions(runtime: Util.RuntimeOptions): ListImagesResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListImages',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listImages(): ListImagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listImagesWithOptions(runtime);
}

model ListJobTemplatesRequest {
  name?: string(name='Name'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  regionId?: string(name='RegionId'),
}

model ListJobTemplatesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  templates?: {
    jobTemplates?: [ 
    {
      arrayRequest?: string(name='ArrayRequest'),
      commandLine?: string(name='CommandLine'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      packagePath?: string(name='PackagePath'),
      priority?: int32(name='Priority'),
      reRunable?: boolean(name='ReRunable'),
      runasUser?: string(name='RunasUser'),
      stderrRedirectPath?: string(name='StderrRedirectPath'),
      stdoutRedirectPath?: string(name='StdoutRedirectPath'),
      variables?: string(name='Variables'),
    }
  ](name='JobTemplates')
  }(name='Templates'),
  totalCount?: int32(name='TotalCount'),
}

model ListJobTemplatesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListJobTemplatesResponseBody(name='body'),
}

async function listJobTemplatesWithOptions(request: ListJobTemplatesRequest, runtime: Util.RuntimeOptions): ListJobTemplatesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJobTemplates',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listJobTemplates(request: ListJobTemplatesRequest): ListJobTemplatesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listJobTemplatesWithOptions(request, runtime);
}

model ListJobsRequest {
  clusterId?: string(name='ClusterId'),
  owner?: string(name='Owner'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  rerunable?: string(name='Rerunable'),
  state?: string(name='State'),
}

model ListJobsResponseBody = {
  jobs?: {
    jobInfo?: [ 
    {
      arrayRequest?: string(name='ArrayRequest'),
      comment?: string(name='Comment'),
      id?: string(name='Id'),
      lastModifyTime?: string(name='LastModifyTime'),
      name?: string(name='Name'),
      owner?: string(name='Owner'),
      priority?: int32(name='Priority'),
      resources?: {
        cores?: int32(name='Cores'),
        nodes?: int32(name='Nodes'),
      }(name='Resources'),
      shellPath?: string(name='ShellPath'),
      startTime?: string(name='StartTime'),
      state?: string(name='State'),
      stderr?: string(name='Stderr'),
      stdout?: string(name='Stdout'),
      submitTime?: string(name='SubmitTime'),
    }
  ](name='JobInfo')
  }(name='Jobs'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListJobsResponseBody(name='body'),
}

async function listJobsWithOptions(request: ListJobsRequest, runtime: Util.RuntimeOptions): ListJobsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListJobs',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listJobs(request: ListJobsRequest): ListJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listJobsWithOptions(request, runtime);
}

model ListNodesRequest {
  clusterId?: string(name='ClusterId'),
  hostName?: string(name='HostName'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  role?: string(name='Role'),
}

model ListNodesResponseBody = {
  nodes?: {
    nodeInfo?: [ 
    {
      addTime?: string(name='AddTime'),
      createdByEhpc?: boolean(name='CreatedByEhpc'),
      expired?: boolean(name='Expired'),
      expiredTime?: string(name='ExpiredTime'),
      id?: string(name='Id'),
      imageId?: string(name='ImageId'),
      imageOwnerAlias?: string(name='ImageOwnerAlias'),
      lockReason?: string(name='LockReason'),
      regionId?: string(name='RegionId'),
      role?: string(name='Role'),
      spotStrategy?: string(name='SpotStrategy'),
      status?: string(name='Status'),
      totalResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='TotalResources'),
      usedResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='UsedResources'),
    }
  ](name='NodeInfo')
  }(name='Nodes'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListNodesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodesResponseBody(name='body'),
}

async function listNodesWithOptions(request: ListNodesRequest, runtime: Util.RuntimeOptions): ListNodesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodes(request: ListNodesRequest): ListNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodesWithOptions(request, runtime);
}

model ListNodesNoPagingRequest {
  clusterId?: string(name='ClusterId'),
  hostName?: string(name='HostName'),
  onlyDetached?: boolean(name='OnlyDetached'),
  role?: string(name='Role'),
}

model ListNodesNoPagingResponseBody = {
  nodes?: {
    nodeInfo?: [ 
    {
      addTime?: string(name='AddTime'),
      createdByEhpc?: boolean(name='CreatedByEhpc'),
      expired?: boolean(name='Expired'),
      expiredTime?: string(name='ExpiredTime'),
      id?: string(name='Id'),
      imageId?: string(name='ImageId'),
      imageOwnerAlias?: string(name='ImageOwnerAlias'),
      lockReason?: string(name='LockReason'),
      regionId?: string(name='RegionId'),
      role?: string(name='Role'),
      spotStrategy?: string(name='SpotStrategy'),
      status?: string(name='Status'),
      totalResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='TotalResources'),
      usedResources?: {
        cpu?: int32(name='Cpu'),
        gpu?: int32(name='Gpu'),
        memory?: int32(name='Memory'),
      }(name='UsedResources'),
    }
  ](name='NodeInfo')
  }(name='Nodes'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListNodesNoPagingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListNodesNoPagingResponseBody(name='body'),
}

async function listNodesNoPagingWithOptions(request: ListNodesNoPagingRequest, runtime: Util.RuntimeOptions): ListNodesNoPagingResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListNodesNoPaging',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listNodesNoPaging(request: ListNodesNoPagingRequest): ListNodesNoPagingResponse {
  var runtime = new Util.RuntimeOptions{};
  return listNodesNoPagingWithOptions(request, runtime);
}

model ListPreferredEcsTypesRequest {
  spotStrategy?: string(name='SpotStrategy'),
  zoneId?: string(name='ZoneId'),
}

model ListPreferredEcsTypesResponseBody = {
  requestId?: string(name='RequestId'),
  series?: {
    seriesInfo?: [ 
    {
      roles?: {
        compute?: {
          instanceTypeId?: [ string ](name='InstanceTypeId')
        }(name='Compute'),
        login?: {
          instanceTypeId?: [ string ](name='InstanceTypeId')
        }(name='Login'),
        manager?: {
          instanceTypeId?: [ string ](name='InstanceTypeId')
        }(name='Manager'),
      }(name='Roles'),
      seriesId?: string(name='SeriesId'),
      seriesName?: string(name='SeriesName'),
    }
  ](name='SeriesInfo')
  }(name='Series'),
  supportSpotInstance?: boolean(name='SupportSpotInstance'),
}

model ListPreferredEcsTypesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListPreferredEcsTypesResponseBody(name='body'),
}

async function listPreferredEcsTypesWithOptions(request: ListPreferredEcsTypesRequest, runtime: Util.RuntimeOptions): ListPreferredEcsTypesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListPreferredEcsTypes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listPreferredEcsTypes(request: ListPreferredEcsTypesRequest): ListPreferredEcsTypesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listPreferredEcsTypesWithOptions(request, runtime);
}

model ListRegionsResponseBody = {
  regions?: {
    regionInfo?: [ 
    {
      localName?: string(name='LocalName'),
      regionId?: string(name='RegionId'),
    }
  ](name='RegionInfo')
  }(name='Regions'),
  requestId?: string(name='RequestId'),
}

model ListRegionsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRegionsResponseBody(name='body'),
}

async function listRegionsWithOptions(runtime: Util.RuntimeOptions): ListRegionsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListRegions',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRegions(): ListRegionsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRegionsWithOptions(runtime);
}

model ListSoftwaresRequest {
  ehpcVersion?: string(name='EhpcVersion'),
}

model ListSoftwaresResponseBody = {
  requestId?: string(name='RequestId'),
  softwares?: {
    softwareInfo?: [ 
    {
      accountType?: string(name='AccountType'),
      accountVersion?: string(name='AccountVersion'),
      applications?: {
        applicationInfo?: [ 
        {
          name?: string(name='Name'),
          required?: boolean(name='Required'),
          tag?: string(name='Tag'),
          version?: string(name='Version'),
        }
      ](name='ApplicationInfo')
      }(name='Applications'),
      ehpcVersion?: string(name='EhpcVersion'),
      osTag?: string(name='OsTag'),
      schedulerType?: string(name='SchedulerType'),
      schedulerVersion?: string(name='SchedulerVersion'),
    }
  ](name='SoftwareInfo')
  }(name='Softwares'),
}

model ListSoftwaresResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListSoftwaresResponseBody(name='body'),
}

async function listSoftwaresWithOptions(request: ListSoftwaresRequest, runtime: Util.RuntimeOptions): ListSoftwaresResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListSoftwares',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listSoftwares(request: ListSoftwaresRequest): ListSoftwaresResponse {
  var runtime = new Util.RuntimeOptions{};
  return listSoftwaresWithOptions(request, runtime);
}

model ListUsersRequest {
  clusterId?: string(name='ClusterId'),
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListUsersResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  users?: {
    userInfo?: [ 
    {
      addTime?: string(name='AddTime'),
      group?: string(name='Group'),
      name?: string(name='Name'),
    }
  ](name='UserInfo')
  }(name='Users'),
}

model ListUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListUsersResponseBody(name='body'),
}

async function listUsersWithOptions(request: ListUsersRequest, runtime: Util.RuntimeOptions): ListUsersResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListUsers',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listUsers(request: ListUsersRequest): ListUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listUsersWithOptions(request, runtime);
}

model ListVolumesRequest {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
}

model ListVolumesResponseBody = {
  pageNumber?: int32(name='PageNumber'),
  pageSize?: int32(name='PageSize'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
  volumes?: {
    volumeInfo?: [ 
    {
      clusterId?: string(name='ClusterId'),
      clusterName?: string(name='ClusterName'),
      regionId?: string(name='RegionId'),
      remoteDirectory?: string(name='RemoteDirectory'),
      volumeId?: string(name='VolumeId'),
      volumeMountpoint?: string(name='VolumeMountpoint'),
      volumeProtocol?: string(name='VolumeProtocol'),
      volumeType?: string(name='VolumeType'),
    }
  ](name='VolumeInfo')
  }(name='Volumes'),
}

model ListVolumesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListVolumesResponseBody(name='body'),
}

async function listVolumesWithOptions(request: ListVolumesRequest, runtime: Util.RuntimeOptions): ListVolumesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ListVolumes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listVolumes(request: ListVolumesRequest): ListVolumesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listVolumesWithOptions(request, runtime);
}

model ModifyClusterAttributesRequest {
  clusterId?: string(name='ClusterId'),
  description?: string(name='Description'),
  name?: string(name='Name'),
}

model ModifyClusterAttributesResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyClusterAttributesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyClusterAttributesResponseBody(name='body'),
}

async function modifyClusterAttributesWithOptions(request: ModifyClusterAttributesRequest, runtime: Util.RuntimeOptions): ModifyClusterAttributesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyClusterAttributes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyClusterAttributes(request: ModifyClusterAttributesRequest): ModifyClusterAttributesResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyClusterAttributesWithOptions(request, runtime);
}

model ModifyUserGroupsRequest {
  clusterId?: string(name='ClusterId'),
  user?: [ 
    {
      group?: string(name='Group'),
      name?: string(name='Name'),
    }
  ](name='User'),
}

model ModifyUserGroupsResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyUserGroupsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyUserGroupsResponseBody(name='body'),
}

async function modifyUserGroupsWithOptions(request: ModifyUserGroupsRequest, runtime: Util.RuntimeOptions): ModifyUserGroupsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyUserGroups',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyUserGroups(request: ModifyUserGroupsRequest): ModifyUserGroupsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyUserGroupsWithOptions(request, runtime);
}

model ModifyUserPasswordsRequest {
  clusterId?: string(name='ClusterId'),
  user?: [ 
    {
      name?: string(name='Name'),
      password?: string(name='Password'),
    }
  ](name='User'),
}

model ModifyUserPasswordsResponseBody = {
  requestId?: string(name='RequestId'),
}

model ModifyUserPasswordsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ModifyUserPasswordsResponseBody(name='body'),
}

async function modifyUserPasswordsWithOptions(request: ModifyUserPasswordsRequest, runtime: Util.RuntimeOptions): ModifyUserPasswordsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ModifyUserPasswords',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function modifyUserPasswords(request: ModifyUserPasswordsRequest): ModifyUserPasswordsResponse {
  var runtime = new Util.RuntimeOptions{};
  return modifyUserPasswordsWithOptions(request, runtime);
}

model RerunJobsRequest {
  clusterId?: string(name='ClusterId'),
  jobs?: string(name='Jobs'),
}

model RerunJobsResponseBody = {
  requestId?: string(name='RequestId'),
}

model RerunJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RerunJobsResponseBody(name='body'),
}

async function rerunJobsWithOptions(request: RerunJobsRequest, runtime: Util.RuntimeOptions): RerunJobsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'RerunJobs',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function rerunJobs(request: RerunJobsRequest): RerunJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return rerunJobsWithOptions(request, runtime);
}

model ResetNodesRequest {
  clusterId?: string(name='ClusterId'),
  instance?: [ 
    {
      id?: string(name='Id'),
    }
  ](name='Instance'),
}

model ResetNodesResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetNodesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ResetNodesResponseBody(name='body'),
}

async function resetNodesWithOptions(request: ResetNodesRequest, runtime: Util.RuntimeOptions): ResetNodesResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'ResetNodes',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function resetNodes(request: ResetNodesRequest): ResetNodesResponse {
  var runtime = new Util.RuntimeOptions{};
  return resetNodesWithOptions(request, runtime);
}

model SetAutoScaleConfigRequest {
  clusterId?: string(name='ClusterId'),
  enableAutoGrow?: boolean(name='EnableAutoGrow'),
  enableAutoShrink?: boolean(name='EnableAutoShrink'),
  excludeNodes?: string(name='ExcludeNodes'),
  extraNodesGrowRatio?: int32(name='ExtraNodesGrowRatio'),
  growIntervalInMinutes?: int32(name='GrowIntervalInMinutes'),
  growRatio?: int32(name='GrowRatio'),
  growTimeoutInMinutes?: int32(name='GrowTimeoutInMinutes'),
  maxNodesInCluster?: int32(name='MaxNodesInCluster'),
  shrinkIdleTimes?: int32(name='ShrinkIdleTimes'),
  shrinkIntervalInMinutes?: int32(name='ShrinkIntervalInMinutes'),
}

model SetAutoScaleConfigResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetAutoScaleConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetAutoScaleConfigResponseBody(name='body'),
}

async function setAutoScaleConfigWithOptions(request: SetAutoScaleConfigRequest, runtime: Util.RuntimeOptions): SetAutoScaleConfigResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetAutoScaleConfig',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setAutoScaleConfig(request: SetAutoScaleConfigRequest): SetAutoScaleConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return setAutoScaleConfigWithOptions(request, runtime);
}

model SetJobUserRequest {
  clusterId?: string(name='ClusterId'),
  runasUser?: string(name='RunasUser'),
  runasUserPassword?: string(name='RunasUserPassword'),
}

model SetJobUserResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetJobUserResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetJobUserResponseBody(name='body'),
}

async function setJobUserWithOptions(request: SetJobUserRequest, runtime: Util.RuntimeOptions): SetJobUserResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SetJobUser',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setJobUser(request: SetJobUserRequest): SetJobUserResponse {
  var runtime = new Util.RuntimeOptions{};
  return setJobUserWithOptions(request, runtime);
}

model StopJobsRequest {
  clusterId?: string(name='ClusterId'),
  jobs?: string(name='Jobs'),
}

model StopJobsResponseBody = {
  requestId?: string(name='RequestId'),
}

model StopJobsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: StopJobsResponseBody(name='body'),
}

async function stopJobsWithOptions(request: StopJobsRequest, runtime: Util.RuntimeOptions): StopJobsResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'StopJobs',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function stopJobs(request: StopJobsRequest): StopJobsResponse {
  var runtime = new Util.RuntimeOptions{};
  return stopJobsWithOptions(request, runtime);
}

model SubmitJobRequest {
  arrayRequest?: string(name='ArrayRequest'),
  clusterId?: string(name='ClusterId'),
  commandLine?: string(name='CommandLine'),
  name?: string(name='Name'),
  packagePath?: string(name='PackagePath'),
  priority?: int32(name='Priority'),
  reRunable?: boolean(name='ReRunable'),
  runasUser?: string(name='RunasUser'),
  runasUserPassword?: string(name='RunasUserPassword'),
  stderrRedirectPath?: string(name='StderrRedirectPath'),
  stdoutRedirectPath?: string(name='StdoutRedirectPath'),
  variables?: string(name='Variables'),
}

model SubmitJobResponseBody = {
  jobId?: string(name='JobId'),
  requestId?: string(name='RequestId'),
}

model SubmitJobResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SubmitJobResponseBody(name='body'),
}

async function submitJobWithOptions(request: SubmitJobRequest, runtime: Util.RuntimeOptions): SubmitJobResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'SubmitJob',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function submitJob(request: SubmitJobRequest): SubmitJobResponse {
  var runtime = new Util.RuntimeOptions{};
  return submitJobWithOptions(request, runtime);
}

model UpgradeClientRequest {
  clientVersion?: string(name='ClientVersion'),
  clusterId?: string(name='ClusterId'),
}

model UpgradeClientResponseBody = {
  requestId?: string(name='RequestId'),
}

model UpgradeClientResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpgradeClientResponseBody(name='body'),
}

async function upgradeClientWithOptions(request: UpgradeClientRequest, runtime: Util.RuntimeOptions): UpgradeClientResponse {
  Util.validateModel(request);
  var query = OpenApiUtil.query(Util.toMap(request));
  var req = new OpenApi.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApi.Params{
    action = 'UpgradeClient',
    version = '2017-07-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'GET',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function upgradeClient(request: UpgradeClientRequest): UpgradeClientResponse {
  var runtime = new Util.RuntimeOptions{};
  return upgradeClientWithOptions(request, runtime);
}

